<?php $data = modules::run('products/get_list_products_home'); ?>
<?php if(!empty($data)){ ?>
<div class="homebox">
    <div class="container home">
        <div class="row">
            <?php foreach($data as $key => $value){
                if(SLUG_ACTIVE==0){
                    $uri = get_base_url() . url_title(trim($value->product_name), 'dash', TRUE) . '-ps' . $value->id;
                }else{
                    $uri = get_base_url() . $value->slug;
                }
                $image = is_null($value->image_name) ? base_url().'images/no-image.png' : base_url().'images/products/thumbnails/'.$value->image_name;
                $value_name = limit_text($value->product_name, 100);
                $value_category = limit_text($value->category, 100);
                $price = $value->price != 0 ? get_price_in_vnd($value->price) . ' ₫' : get_price_in_vnd($value->price);        
            ?>
           <div class="col-sm-4 item item_products">
                <div class="item-image">
                    <a title="<?php echo $value->product_name; ?>" href="<?php echo $uri; ?>">
                        <img alt="" title="<?php echo $value->product_name; ?>" src="<?php echo $image; ?>" />
                    </a>
                </div>
                <span class="category"><?php echo $value_category; ?></span>
                <span class="item-comments">
                    <a title="Bình luận bài <?php echo $value->product_name; ?>" href="<?php echo $uri; ?>#comments">
                        <span class="fb_comments_count"><?php echo $value->viewed; ?></span> Lượt xem
                    </a>
                </span>
                <h3><a title="<?php echo $value->product_name; ?>" href="<?php echo $uri; ?>"><?php echo $value_name; ?></a></h3>
                <h4><?php echo $price; ?></h4>
            </div>
           <?php } ?>
        </div>
    </div>
</div>
<?php } ?>